package java_DesignPattern.BehavioralPattern.Chain_of_responsibilityPattern;

/**
 * 责任链模式---测试类
 */
public class Test {

    public static void main(String[] args) {

        //创建请假条
        Leave leave = new Leave("张三", 3, "因为工作需要请假3天");

        //创建责任链
        Handler temer = new Temer();
        Handler manager = new Manager();
        Handler boss = new Boss();

        //设置责任链
        temer.setNextHandler(manager);
        manager.setNextHandler(boss);

        //处理请假条
        temer.handleRequest(leave);
    }
}
